package data.content.visitor;

import client.gui.roombox.RoomBoxView;
import data.content.ContentSentence;
import data.content.ContentStalkerJoin;
import data.content.ContentStalkerLeaves;

public class ShowContentVisitor extends ContentVisitor<Void> {
  
  private final RoomBoxView box_;
  
  public ShowContentVisitor(RoomBoxView box) {
    assert box != null;
    box_ = box;
  }
  
  @Override
  public Void visit(ContentSentence sentence) {
    assert sentence != null;
    box_.appendText(sentence.getSentence());
    return null;
  }

  @Override
  public Void visit(ContentStalkerJoin stalkerJoin) {
    assert stalkerJoin != null;
    //puts message
    box_.appendText(stalkerJoin.getStalker().getName() + " joins.");
    return null;
  }

  @Override
  public Void visit(ContentStalkerLeaves stalkerLeave) {
    assert stalkerLeave != null;
    
    box_.appendText(stalkerLeave.getStalker().getName() + " leaves.");
    return null;
  }

}
